﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace IClient
{
    public partial class Login : Form
    {
        public Login( )
        {
            InitializeComponent( );
        }

        public static string name;
        private void Login_Load( object sender, EventArgs e )
        {

            login_panel.Visible = !globalData.first_login;
        }

        private void btn_login_Click( object sender, EventArgs e )
        {
            if ( string.IsNullOrEmpty( login_inputbox.Text ) )
            {
                MessageBox.Show( "新的昵称不能为空", "wow~" );
                return;
            }

            name = login_inputbox.Text;
            this.DialogResult = DialogResult.OK;
            this.Dispose( );
            this.Close( );
        }

        private void btn_register_Click( object sender, EventArgs e )
        {
      
            if( string.IsNullOrEmpty( register_inputbox.Text ) )
            {
                MessageBox.Show( "昵称不能为空", "wow~" );
                return;
            }
            
            name = register_inputbox.Text;
            this.DialogResult = DialogResult.OK;
            this.Dispose( );
            this.Close( );
        }
    }
}
